<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>复检</title>
		<link href="../css/mui.min.css" rel="stylesheet" type="text/css">
		<link href="../css/home.page.css" rel="stylesheet" />
		<link href="../bootstrap-select/bootstrap-select.css" rel="stylesheet">
		<link href="../css/bootstrap.min.css" rel="stylesheet" >
		<link href="../css/mui.picker.min.css" rel="stylesheet" >
		<script charset="UTF-8" src="../js/jquery.min.js"></script>
		<script charset="UTF-8" src="../js/config.js"></script>
		<script charset="UTF-8" src="../js/core.js"></script>
		<script charset="UTF-8" src="../js/cipher-core.js"></script>
		<script charset="UTF-8" src="../js/tripledes.js"></script>
		<script charset="UTF-8" src="../js/mode-ecb.js"></script>
		<script charset="UTF-8" src="../js/zepto.min.js"></script>
		<script charset="UTF-8" src="../js/spin.min.js"></script>
		<script charset="UTF-8" src="../js/mui.min.js"></script>
		<script charset="UTF-8" src="../js/testActivityName.js"></script>
		<script charset="UTF-8" src="../js/simple.tool.js"></script>
		<script charset="UTF-8" src="../js/mui.picker.min.js"></script>
		<style>
			label{
				text-align: right;
			}
			.btn-default{
				border-color: snow;
			}
			.form-control{
				-webkit-box-shadow: inset 0 0px 0px rgba(0,0,0,.075);
			}
			.form-group{
				border-bottom: 1px solid #f6f6f6;max-width: 720px;height: 55px;
			}
		</style>
	</head>
	<body class="white-bg" >
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" style="width: 95%;" id="form-initialinspection-add" target="ifr">
			<div class="form-group" style="margin-bottom: 0px;border-bottom: 0px solid #f6f6f6;">
				<div class="head-jnx" onclick="record()">
					<img src="../img/fanhui@3x.png"  />
					<p>复检</p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-4 control-label">耳号：<span style="color: red">*</span></label>
				<div class="col-xs-7">
					<select name="cowId" class="selectpicker form-control m-b" data-live-search="true" title="选择耳号"   data-size="10" id="overbit" required>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-4 control-label">检测日期：<span style="color: red">*</span></label>
				<div class="col-xs-7">
					<div class="input-group date">
						<!--<span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
						<input id="inspectionDate" type="text" onfocus=this.blur() onclick="dtPicker('inspectionDate')">
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-4 control-label">检测员：</label>
				<div class="col-xs-7">
					<select name="inspector" style="/* display: table-cell; */vertical-align: middle;text-align: left;width: 100%;" id="inspector">
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-4 control-label">检测结果：<span style="color: red">*</span></label>
				<div class="col-xs-7">
					<select name="inspectionResultId" style="/* display: table-cell; */vertical-align: middle;text-align: left;width: 100%;" id="inspectionResultId" required>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-4 control-label">冻精类型：</label>
				<div class="col-xs-7">
					<select name="semenId" style="/* display: table-cell; */vertical-align: middle;text-align: left;width: 100%;" id="semenId">
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-4 control-label">孕测：</label>
				<div class="col-xs-7">
					<select name="pregnantInspectionId" style="/* display: table-cell; */vertical-align: middle;text-align: left;width: 100%;" id="pregnantInspectionId">
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-4 control-label">检测协助人：</label>
				<div class="col-xs-7">
					<select name="initialAssistantPersonnel" style="/* display: table-cell; */vertical-align: middle;text-align: left;width: 100%;" id="initialAssistantPersonnel">
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-4 control-label">子宫状态：</label>
				<div class="col-xs-7">
					<select name="uterineState" style="/* display: table-cell; */vertical-align: middle;text-align: left;width: 100%;" id="uterineState">
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-4 control-label">备注：</label>
				<div class="col-xs-7">
					<input name="remake" class="form-control" type="text" placeholder="请输入" >
				</div>
			</div>
			<div class="form-group">
				<div style="width: 320px; margin: auto;">
					<div class="quxiao-btn" style="margin-right: 15px;" onclick="record()">取消</div>
					<input type="submit" value="保存信息" class="quxiao-btn" style="background: #0078fb; color: #FFFFFF;border-radius: 55px;" >
					<div class="clear"></div>
				</div>
			</div>
		</form>
	</div>
	<iframe name='ifr' id="ifr" style='display: none;'></iframe><!--表单提交防止刷新-->
	<script src="../js/bootstrap.min.js"></script>
	<script src="../bootstrap-select/bootstrap-select.js"></script>
	<script>
		window.onload=breedLoad();
		function breedLoad() {//获得下拉数据
			var resultData = JSON.parse(localStorage.getItem('addrecheckdata'));
			breedHtml(resultData.data);
			$("#inspectionDate").val(getDateNow());
		}
		$("#form-initialinspection-add").submit(function () {
			map={};
			map=$('#form-initialinspection-add').serializeObject();
			map.url="addrecheck";
			map.overbit=$("#overbit option:selected").text();
		 	var resultData=ajaxRequestPostSubmit(map);
			if (resultData.head.info == "增加成功") {
				setTimeout(function () {
					record();
				}, 1000);
			}
		});
		function loadSelect(id,data,code,name,userName) {
			$("#"+id).html("");
			$("#"+id).append("<option value=''>请选择</option>");
			for (i=0;i<data.length;i++){//
				var str='';
				if(userName != null && data[i][name] == userName){
					str='<option value="'+data[i][code]+'" selected>'+data[i][name]+'</option>';
				}else{
					str='<option value="'+data[i][code]+'">'+data[i][name]+'</option>';
				}
				$("#"+id).append(str);
			}
		}
		function breedHtml(resultData) {//加载下拉框
			var overbitList=resultData.overbitList;//耳号
			loadSelect('overbit',overbitList,'cow_id','overbit');
			var breederList=resultData.breederList;//复检员
			var userName = resultData.realName;
			loadSelect('inspector',breederList,'real_name','real_name',userName);
			var reExaminationResultList=resultData.reExaminationResultList;//监测结果
			loadSelect('inspectionResultId',reExaminationResultList,'code','name');
			var semenTypeList=resultData.semenTypeList;//冻精类型
			loadSelect('semenId',semenTypeList,'code','name');
			var pregnantInspectionList=resultData.pregnantInspectionList;
			loadSelect('pregnantInspectionId',pregnantInspectionList,'code','name');
			var breederList=resultData.breederList;//监测人
			loadSelect('initialAssistantPersonnel',breederList,'real_name','real_name');
			var uterineStateList=resultData.uterineStateList;//子宫状态
			loadSelect('uterineState',uterineStateList,'code','name');
			$('.selectpicker').selectpicker('refresh');
		}
		function record() {//返回记录
			window.location = "../记录.html";
		}
		
		
	</script>
	</body>

</html>